// 激活码
import request from "@/utils/service"
import type * as IExpired from "./types/expired"

/** 获取机器码 */
export function getMachineCodeApi() {
  return request<IExpired.ExpiredResponseData<string>>({
    url: "/api/v2/author/getUuid",
    method: "get"
  })
}
/**
 * @description: 激活平台使用权限
 * @param {string} code 激活码
 */
export function activatePlatformApi(data: { passnum: string }) {
  return request<IExpired.ExpiredResponseData<any>>({
    url: "/api/v2/author/auto_pass",
    method: "post",
    data
  })
}
/**
 * @description: 获取平台使用范围日期（用于判断是否过期，注意：开始日期和结束日期相同时，说明可以永久使用本平台）
 */

export function getExpireDateRangeApi() {
  return request<IExpired.ExpiredResponseData<IExpired.IExpiredRangeResult>>({
    url: "/api/v2/author/getAuthorDate",
    method: "get"
  })
}
